<?php

class LoginService extends BaseService {
	
	public function login($username, $password) {
		$employeeAccount = new Employee_Domain();
		
		$employeeAccount->setEmployeeId($username);
		$employeeAccount->setPassword($password);
		
		$employeeManager = new EmployeeManager();
		
		$employeeManager->setObj($employeeAccount);
		
		$employeeManager->query();
		
		return $employeeManager->getResult();
	}
	
	public function saveLogin($employee){
		$loginManager = new LoginManager();
		$loginManager->setObj($employee);
		$loginManager->add();
	}
	
	public function saveLogout($employee){
		$loginManager = new LoginManager();
		$loginManager->setObj($employee);
		$loginManager->update();
	}
	
	public function getAlertProd(){
		$productManager = new ProductsManager();
		$productManager->getAlertProd();
		return $productManager->getResult();
	}
}